<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"   
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui"
      xmlns:sec="http://www.springframework.org/security/tags" 
      xmlns:ui="http://java.sun.com/jsf/facelets"
      >
    <h:head>
        <link type="text/css" rel="stylesheet" href="resources/css/default.css" />     
        <h:outputScript name="calendar_ru.js" library="js"/>
    </h:head>

    <h:body>
        
        <table width="100%" align="center" border="1">
            <tr>
                <td width="100%">
                    <table width="100%" border="1" align="center">
                        <td align="center">
                            <ui:include src="fortop.xhtml"/>
                        </td>
                    </table>
                </td>
            </tr>
            <tr>
                <table width="100%" border="1" align="top">
                    <td width="15%" valign="top">
                        <ui:include src="left.xhtml"/>
                    </td>
            <td align="center">
                <h:form id="form">
               
                    <p:panel header="Регистрация" id="panel">
                        <h:panelGrid columns="1">
                           <p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" /> 
                            
                        </h:panelGrid>
                        <h:panelGrid columns="3">
                            <h:outputLabel for="name" value="Имя" />  
                            <h:outputLabel for="secname" value="Фамилия " />  
                            <h:outputLabel for="lastname" value="Отчество" />  
                            <p:inputText id="name" value="#{pacient.name}" required="true" />  
                            <p:inputText id="secname" value="#{pacient.secName}" required="true" />  
                            <p:inputText id="lastname" value="#{pacient.lastName}" required="true" />  
                            <h:outputLabel for="seriya" value="Серия" />  
                            <h:outputLabel for="datarojdeniya" value="Д.Рождения " />  
                            <h:outputLabel for="adres" value="Адрес" />  
                            <p:inputText id="seriya" value="#{pacient.seriya}" required="true" />  
                            <p:calendar  locale="ru" pattern="dd.MM.yyyy" navigator="true" size="10" id="datarojdeniya" value="#{pacient.dataRojdeniya}"/> 
                            <p:inputText id="adres" value="#{pacient.adres}" required="true" />  

                            <h:outputLabel for="contacts" value="Контакты" />  
                            <h:outputLabel for="work" value="Место раблоты" />  
                            <h:outputLabel for="job" value="Профессия" />  
                            <p:inputText id="contacts" value="#{pacient.contacts}" required="true" />  
                            <p:inputText id="work" value="#{pacient.work}" required="true" />  
                            <p:inputText id="job" value="#{pacient.job}" required="true" />  
                        </h:panelGrid>    
                        <h:panelGrid columns="1">
                            <h:outputLabel for="holost" value="Семейное положение" /> 
                            <p:selectOneRadio id="holost" value="#{pacient.holost}">  
                                <f:selectItem itemLabel="Холост" itemValue="0" />  
                                <f:selectItem itemLabel="Женат/Замужем" itemValue="1" />  
                            </p:selectOneRadio>
                            <h:outputLabel for="sex" value="Пол" />  
                            <p:selectOneRadio id="sex" value="#{pacient.sex}">  
                                <f:selectItem itemLabel="М" itemValue="0" />  
                                <f:selectItem itemLabel="Ж" itemValue="1" />  
                            </p:selectOneRadio> 

                            <h:outputLabel for="otdelenie" value="Отделение" />  
                            <p:selectOneMenu value="#{pacient.depId}" effect="fold" id="otdelenie">  
                                <f:selectItems value="#{pacient.getDep()}" />  
                            </p:selectOneMenu> 
                            <p:commandButton actionListener="#{pacient.save()}" value="Сохранить" id="save"/>
                              <p:blockUI block="panel" trigger="save" />
                        </h:panelGrid>    

                    </p:panel> 
                </h:form>


               </td>

                </table>
            </tr>


        </table>
    </h:body>
</html>